package com.mlegrand.firestarter.util
{
	import flash.display.Graphics;
	import flash.display.InterpolationMethod;
	import flash.geom.Matrix;
	
	import mx.skins.halo.HaloBorder;

	public class Gloss extends HaloBorder
	{
		public function Gloss(){}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			
            var g:Graphics = graphics;
            var matrix:Matrix = new Matrix(); 
            //gloss
            matrix.createGradientBox( unscaledWidth, unscaledHeight, (90* Math.PI/180), 0, 0 );
            g.beginGradientFill("linear", [0xB91C20,0xA21C20] , [1,1 ] , [0, 255] , matrix, "pad", InterpolationMethod.RGB  );
            g.drawRect(0, 0, unscaledWidth, unscaledHeight);
            g.endFill();
            //gloss
            matrix.createGradientBox( unscaledWidth, unscaledHeight, (90* Math.PI/180), 0, 0 );
            g.beginGradientFill("linear", [0xFFFFFF,0xFFFFFF] , [0,0.3 ] , [0, 255] , matrix, "pad", InterpolationMethod.RGB  );
            g.drawRect(0, 0, unscaledWidth, unscaledHeight/2);
            g.endFill();
            //darken
            matrix.createGradientBox( unscaledWidth, unscaledHeight, (270* Math.PI/180), 0, 0 );
            g.beginGradientFill("linear", [0x000000,0x000000] , [.4, 0 ] , [0, unscaledHeight/2] , matrix, "pad", InterpolationMethod.RGB  );
            g.drawRect(0, unscaledHeight*.75, unscaledWidth, unscaledHeight/4);
            g.endFill();
		}
	}
}